/*
 * 文件名：OwnerInfoService.java
 * 版权：Copyright by www.huawei.com
 * 描述：
 * 修改人：zhangshaohua
 * 修改时间：2016年4月6日
 * 跟踪单号：
 * 修改单号：
 * 修改内容：
 */

package com.zcsy.manage.service.base.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zcsy.manage.model.base.OwnerInfo;
import com.zcsy.manage.persistence.base.OwnerInfoDao;
import com.zcsy.manage.service.base.IOwnerInfoService;
import com.zcsy.manage.service.system.impl.SystemComService;

@Service
public class OwnerInfoService extends SystemComService implements IOwnerInfoService{
	
	@Autowired
	private OwnerInfoDao ownerInfoDao;

	@Override
	public int insert(OwnerInfo ownerInfo) {
		return ownerInfoDao.insert(ownerInfo);
	}

	@Override
	public int update(OwnerInfo ownerInfo) {
		OwnerInfo oldInfo = ownerInfoDao.selectByPrimaryKey(ownerInfo.getId());
		
		oldInfo.setState(ownerInfo.getState());
		oldInfo.setPassword(ownerInfo.getPassword());
		
		return ownerInfoDao.update(oldInfo);
	}

	@Override
	public int deleteByPrimaryKey(String id) {
		return ownerInfoDao.deleteByPrimaryKey(id);
	}

	@Override
	public OwnerInfo selectByPrimaryKey(String id) {
		return ownerInfoDao.selectByPrimaryKey(id);
	}

	@Override
	public List<OwnerInfo> getAllOwnerInfo() {
		return ownerInfoDao.getAllOwnerInfo();
	}

	@Override
	public List<OwnerInfo> selectByKeyword(OwnerInfo ownerInfo) {
		return ownerInfoDao.selectByKeyword(ownerInfo);
	}

	@Override
	public int clearAllIntegral() {
		return ownerInfoDao.clearAllIntegral();
	}
}
